home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d21 / dvglue10.arc / DVAPI.C < prev    next >
C/C++ Source or Header  |  1988-08-13  |  4KB  |  146 lines

  1. /*=======================================================*/
  2. /*  DVAPI.C                                              */
  3. /*   miscellaneous DESQview API functions that don't     */
  4. /*   require MASM to recompile                           */
  5. /*                                                       */
  6. /*  (c) Copyright 1988 Ralf Brown  All Rights Reserved   */
  7. /*  May be freely copied for noncommercial use, so long  */
  8. /*  as this copyright notice remains intact, and any     */
  9. /*  changes are marked in the comment blocks preceding   */
  10. /*  functions.                                           */
  11. /*=======================================================*/
  12.  
  13. #include <string.h>
  14. #include "tvapi.h"
  15.  
  16. /*======================================================*/
  17. /* DVprogname--return offset of program's name in       */
  18. /*             DESQVIEW.DVO                             */
  19. /*   Ralf Brown 4/2/88                                  */
  20. /*======================================================*/
  21.  
  22. WORD pascal DVprogname(void)
  23. {
  24. #ifdef __TURBOC__
  25.    _AX = 0xDE00 ;
  26.    geninterrupt(0x15) ;
  27.    return _AX ;
  28. #else
  29.    union REGS regs ;
  30.  
  31.    regs.x.ax = 0xDE00 ;
  32.    int86(0x15,®s,®s) ;
  33.    return regs.x.ax ;
  34. #endif __TURBOC__
  35. }
  36.  
  37. /*======================================================*/
  38. /* DVappnum--return application's number as it appears  */
  39. /*           on the "Switch Window" menu                */
  40. /*   Ralf Brown 4/3/88                                  */
  41. /*======================================================*/
  42.  
  43. int pascal DVappnum(void)
  44. {
  45. #ifdef __TURBOC__
  46.    _AX = 0xDE07 ;
  47.    geninterrupt(0x15) ;
  48.    return _AX ;
  49. #else
  50.    union REGS regs ;
  51.  
  52.    regs.x.ax = 0xDE07 ;
  53.    int86(0x15,®s,®s) ;
  54.    return regs.x.ax ;
  55. #endif __TURBOC__
  56. }
  57.  
  58. /*======================================================*/
  59. /* DVdbgpoke--poke a character directly into screen mem */
  60. /*            on the bottom line                        */
  61. /*   Ralf Brown 4/3/88                                  */
  62. /*======================================================*/
  63.  
  64. void pascal DVdbgpoke(char c)
  65. {
  66. #ifdef __TURBOC__
  67.    _BL = c ;
  68.    _AX = 0xDE0A ;
  69.    geninterrupt(0x15) ;
  70. #else
  71.    union REGS regs ;
  72.  
  73.    regs.x.ax = 0xDE0A ;
  74.    regs.h.bl = c ;
  75.    int86(0x15,®s,®s)
  76. #endif __TURBOC__
  77. }
  78.  
  79. /*======================================================*/
  80. /* DVapilevel--define the minimum API level required    */
  81. /*   Ralf Brown 4/3/88                                  */
  82. /*======================================================*/
  83.  
  84. void pascal DVapilevel(int level, int mod)
  85. {
  86. #ifdef __TURBOC__
  87.    _BL = level ;
  88.    _BH = mod ;
  89.    _AX = 0xDE0B ;
  90.    geninterrupt(0x15) ;
  91. #else
  92.    union REGS regs ;
  93.    regs.x.ax = 0xDE0B ;
  94.    regs.h.bh = mod ;
  95.    regs.h.bl = level ;
  96.    int86(0x15,®s,®s) ;
  97. #endif __TURBOC__
  98. }
  99.  
  100. /*======================================================*/
  101. /* DVpushkey--put key into keyboard input stream        */
  102. /*   Ralf Brown 4/3/88                                  */
  103. /*======================================================*/
  104.  
  105. WORD pascal DVpushkey(int key, int scancode)
  106. {
  107. #ifdef __TURBOC__
  108.    _BL = key ;
  109.    _BH = scancode ;
  110.    _AX = 0xDE10 ;
  111.    geninterrupt(0x15) ;
  112.    return _BX ;   /* usually, but not always, same as BX passed in */
  113. #else
  114.    union REGS regs ;
  115.  
  116.    regs.x.ax = 0xDE10 ;
  117.    regs.h.bl = key ;
  118.    regs.h.bh = scancode ;
  119.    int86(0x15,®s,®s) ;
  120.    return regs.x.bx ;
  121. #endif __TURBOC__
  122. }
  123.  
  124. /*======================================================*/
  125. /* DVjustify  set whether visible part of window follows*/
  126. /*            cursor                                    */
  127. /*   Ralf Brown 4/8/88                                  */
  128. /*======================================================*/
  129.  
  130. void pascal DVjustify(int justify)
  131. {
  132. #ifdef __TURBOC__
  133.    _BL = justify ;
  134.    _AX = 0xDE11 ;
  135.    geninterrupt(0x15) ;
  136. #else
  137.    union REGS regs ;
  138.  
  139.    regs.x.ax = 0xDE11 ;
  140.    regs.h.bl = justify ;
  141.    int86(0x15,®s,®s) ;
  142. #endif __TURBOC__
  143. }
  144.  
  145. /* End of DVAPI.C */
  146.